package com.develop.skwen.electricgomall.util;

import com.develop.skwen.electricgomall.category.model.CategoryBean;
import com.develop.skwen.electricgomall.category.model.CategoryItemBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by skwen on 2018/7/8.
 */

public class CategoryDataUtil {

    private String categoryBeans[] = {"手机", "电脑", "平板", "配件", "显示器", "外设", "打印机", "投影仪"};
    private int categoryTypes[] = {1, 2, 3, 4, 5, 6, 7, 8};

    private String categoryItemBeanIcon = "http://img2.zol.com.cn/product/190/902/cee1PflmqGzIw.jpg";

    private String categoryItemBeanName = "品牌";


    private static CategoryDataUtil categoryDataUtil;

    private CategoryDataUtil() {

    }

    public static CategoryDataUtil getInstance() {
        if (categoryDataUtil == null) {
            synchronized (CategoryDataUtil.class) {
                if (categoryDataUtil == null) {
                    categoryDataUtil = new CategoryDataUtil();
                }
            }
        }
        return categoryDataUtil;
    }


    public List<CategoryBean> getCategoryBeans() {
        List<CategoryBean> list = new ArrayList<>();
        for (int i = 0; i < categoryBeans.length; i++) {
            CategoryBean item = new CategoryBean();
            item.setId(i);
            item.setType(categoryTypes[i]);
            item.setName(categoryBeans[i]);
            list.add(item);
        }
        return list;
    }



    public List<CategoryItemBean> getCategoryItemBeans() {
        List<CategoryItemBean> list = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            CategoryItemBean item = new CategoryItemBean();
            item.setIcon(categoryItemBeanIcon);
            item.setName(categoryItemBeanName);
            list.add(item);
        }
        return list;
    }

}
